home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / dev / mouse.man < prev    next >
Text File  |  1989-06-25  |  4KB  |  94 lines

  1. '\" Copyright 1989 Regents of the University of California
  2. '\" Permission to use, copy, modify, and distribute this
  3. '\" documentation for any purpose and without fee is hereby
  4. '\" granted, provided that this notice appears in all copies.
  5. '\" The University of California makes no representations about
  6. '\" the suitability of this material for any purpose.  It is
  7. '\" provided "as is" without express or implied warranty.
  8. '\" 
  9. '\" $Header: /sprite/src/man/dev/RCS/mouse.man,v 1.2 89/06/25 17:11:24 ouster Exp $ SPRITE (Berkeley)
  10. '/" 
  11. .so \*(]ltmac.sprite
  12. .HS MOUSE dev
  13. .BS
  14. '\" Note:  do not modify the .SH NAME line immediately below!
  15. .SH NAME
  16. mouse \- Devices used to read mouse and keyboard events for window systems
  17. .SH SYNOPSIS
  18. \fB#include <dev/mouse.h>\fR
  19. .BE
  20.  
  21. .SH DESCRIPTION
  22. .PP
  23. Mouse devices are used by window systems to communicate with the
  24. raw keyboard and mouse.  Each \fBread\fR kernel call
  25. on a mouse device returns one or more structures of the following format:
  26. .DS
  27. \fCtypedef struct {
  28.     int flags;
  29.     int key;
  30.     int deltaX;
  31.     int deltaY;
  32.     unsigned int time;
  33. } Mouse_Event;\fR
  34. .DE
  35. The buffer specified to a \fBread\fR kernel call must be large
  36. enough to hold at least one \fBMouse_Event\fR.
  37. The \fIflags\fR field is an OR-ed combination of the following bit masks:
  38. .IP \fBMOUSE_EVENT\fR 25
  39. Means that a mouse button was pressed or released, or the mouse moved.
  40. .IP \fBKEYBOARD_EVENT\fR 25
  41. Means that a key was pressed or released on the keyboard.  Only one
  42. of \fBMOUSE_EVENT\fR or \fBKEYBOARD_EVENT\fR will be set in any
  43. particular event.
  44. .IP \fBKEY_UP\fR 25
  45. This bit is only relevant for keyboard events.  If set, it implies that
  46. the key was released;  otherwise, the key was pressed.
  47. .PP
  48. For mouse events, the \fIkey\fR field contains a bit mask indicating
  49. which mouse buttons are currently depressed.  The \fIdeltaX\fR and
  50. \fIdeltaY\fR fields indicate how much the mouse has moved (in
  51. pixels) since the
  52. last mouse-related event.  The \fItime\fR field gives the value of
  53. a free-running millisecond clock at the time the event occurred.
  54. The \fItime\fR value has no absolute significance, but is useful
  55. in comparing times from different events.
  56. .PP
  57. For keyboard events, the \fIkey\fR field gives the number of a
  58. key on the keyboard.  The numbers are keyboard-specific, and are
  59. usually different than the ASCII values represented by the keys.
  60. The \fBKEY_UP\fR mask bit indicates whether the given key just went
  61. up or down.  For ideal keyboards, such as those on most Sun
  62. workstations, separate up and down events occur for each key.
  63. For less-than-ideal keyboards, such as DEC's LK201, down events
  64. occur for all keys, but up events only occur for a few keys such
  65. as shift.  The \fIdeltaX\fR and \fIdeltaY\fR fields have no
  66. significance for keyboard events, and \fItime\fR is the same as
  67. for mouse events.
  68. .PP
  69. Writing to a mouse device has machine-specific effects.  On Suns,
  70. characters written to a mouse device are transmitted to the keyboard
  71. and perform the following special functions, depending on the value
  72. of the character:
  73. .TP 25
  74. \fBKBD_RESET (1)\fR
  75. Reset the keyboard.
  76. .TP 25
  77. \fBKBD_BELL_ON (2)\fR
  78. Turn on the bell.  It will stay on until the \fBKBD_BELL_OFF\fR
  79. character is transmitted.
  80. .TP 25
  81. \fBKBD_BELL_OFF (3)\fR
  82. Turn off the bell.
  83. .TP 25
  84. \fBKBD_CLICK_ON (10) \fR
  85. Generate a click on each keystroke.
  86. .TP 25
  87. \fBKBD_CLICK_OFF (11) \fR
  88. Stop clicking on each keystroke.
  89. .PP
  90. No device-specific IO-control operations are defined for mouse devices.
  91.  
  92. .SH KEYWORDS
  93. event, keyboard, mouse, window system
  94.